package org.example.test915.schedule;

import cn.hutool.json.JSONUtil;
import org.springframework.stereotype.Component;
import tech.powerjob.worker.core.processor.ProcessResult;
import tech.powerjob.worker.core.processor.TaskContext;
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;

import java.util.Map;


@Component
public class TestDelayPowerjobProcess implements BasicProcessor {
    @Override
    public ProcessResult process(TaskContext taskContext) throws Exception {
        // 从taskContext获取注册时注入的参数
        String instanceParams = taskContext.getInstanceParams();
        Map<String,Object> map = JSONUtil.parseObj(instanceParams);
        // 通过参数进行下一步的业务代码
        System.out.println(map);
        return new ProcessResult(true, "调用接口成功");

    }
}
